package com.spring.transaction;

import com.spring.transaction.po.SpringUser;
import com.spring.transaction.service.SpringUserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @ClassName aa
 * @Description
 * @Author suncx
 * @Date 2020/9/21 15:20
 * @Version 1.0
 */

public class Test {
    @org.junit.Test
    public void t1() {
        try {
            ApplicationContext act = new ClassPathXmlApplicationContext("/transaction/spring-transaction.xml");
            SpringUserService userService = (SpringUserService)act.getBean("springUserService");
            userService.save(new SpringUser(1, "scx", 3));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
